# include <iostream> 
# include <fstream> 
# include <opencv/cv.h>
# include <opencv/highgui.h>

using namespace std;

int main (int argc , char * argv []) {

//Create and position a window:

  cvNamedWindow("win1", CV_WINDOW_AUTOSIZE); 
  cvMoveWindow("win1", 100, 100); // offset from the UL corner of the screen

//Load an image:

  IplImage* img=0; 
  img=cvLoadImage("cat.jpg");
  if(!img) printf("Could not load image file: %s\n","cat.jpg");

//Display an image:

  cvShowImage("win1",img);

//Can display a color or grayscale byte/float-image. A byte image is assumed to have values in the range $[0..255]$. A float image is assumed to have values in the range $[0..1]$. A color image is assumed to have data in BGR order.

// Wait for user input
            cvWaitKey(0);

//Close a window:

  cvDestroyWindow("win1");

//Resize a window:

  cvResizeWindow("win1",100,100); // new width/heigh in pixels
}

